# %% 
from EF2D.node import Node

n1=Node(1,0,0,0)
n2=Node(2,1,2,0)
n3=Node(3,2,0,1)
set([n1,n2,n3,3,n2,n1])

# %%
import numpy as np
 
# 定义系数矩阵A和常数向量b
A = np.array([[3, 1, 2],
              [3, 2, 5],
              [6, 7, 5]])
 
b = np.array([11, 22, 17]).reshape((3, 1))
 
# 使用numpy的linalg.solve函数求解线性方程组
x = np.linalg.solve(A, b)
 
print("解向量x为:", x)
# %%
import dill
with open("L:/EF2D/tests/result/job-c3d8-250406xuanbiliang100N-2.dill","rb") as f:
    data=dill.load(f)
# %%
import numpy as np
import pyvista as pv

# 示例:创建一些积分点数据
# 假设积分点的坐标和对应的值
integration_points = np.array([
    [0.0, 0.0, 0.0],  # 积分点 1
    [1.0, 0.0, 0.0],  # 积分点 2
    [0.0, 1.0, 0.0],  # 积分点 3
    [0.0, 0.0, 1.0]   # 积分点 4
])

# 积分点对应的值(例如应力值)
integration_values = np.array([0.1, 0.5, 0.3, 0.8])

# 创建 PolyData 对象
points_data = pv.PolyData(integration_points)
points_data["Integration Values"] = integration_values

# 绘制积分点
plotter = pv.Plotter()
plotter.add_points(points_data, scalars="Integration Values", cmap="viridis", point_size=10)
plotter.show()